<html>
<head>
  <script src="form_utils.js"></script>
  <script>
    function redirect() {
      window.location.replace('navigate_to_same_url_empty_actions.html?done');
      return false;
    }
  </script>
  <script>
    function onLoadHandler() {
      // Signin form with an empty action is displayed first, once submitted,
      // it navigates to same URL with '?done' appended to it so the if
      // statement has the empty action landing page form displayed instead.
      if (location.search == '?done') {
        var landing_page_form = createSimplePasswordForm();
        landing_page_form.action = '';
        landing_page_form.children[1].id = 'not_username_field';
        landing_page_form.children[1].name = 'not_username_field';
        landing_page_form.children[3].id = 'not_password_field';
        landing_page_form.children[3].name = 'not_password_field';
        landing_page_form.children[4].id = 'not_login_button';
        document.body.appendChild(landing_page_form);
      } else {
        var signin_form = createSimplePasswordForm();
        signin_form.action = '';
        signin_form.setAttribute('onsubmit', 'return redirect();');
        document.body.appendChild(signin_form);
      }
    }
  </script>
</head>
<body onload="onLoadHandler();">
</body>
</html>